#ifndef _aky_gpio_H
#define _aky_gpio_H
#include "aky_define.h"



#define KEY_POWER_PORT GPIO0
#define KEY_POWER_PIN Pin_1
#define KEY_POWER   (g_s_flag_group_const.flag_key_power)
#define KEY_POWERIO (((LINK2(CHAR_P,KEY_POWER_PORT) & KEY_POWER_PIN) != 0x00) ? (0x01) : (0x00))//寄存器方式
#define KEY_POWER_PROT_REG  LINK3(CHAR_P,KEY_POWER_PORT,CHAR_M) //PxM
#define KEY_POWER_UP_REG  LINK3(CHAR_P,KEY_POWER_PORT,CHAR_UR)//PxUR


#define KEY_SET_PORT GPIO0
#define KEY_SET_PIN Pin_0
#define KEY_SET   (g_s_flag_group_const.flag_key_set)
#define KEY_SETIO   (((LINK2(CHAR_P,KEY_SET_PORT) & KEY_SET_PIN) != 0x00) ? (0x01) : (0x00))//寄存器方式
#define KEY_SET_PROT_REG  LINK3(CHAR_P,KEY_SET_PORT,CHAR_M)//PxM
#define KEY_SET_UP_REG  LINK3(CHAR_P,KEY_SET_PORT,CHAR_UR)//PxUR

#define KEY_MEM_PORT GPIO0
#define KEY_MEM_PIN Pin_3
#define KEY_MEM   (g_s_flag_group_const.flag_key_mem)
#define KEY_MEMIO   (((LINK2(CHAR_P,KEY_MEM_PORT) & KEY_MEM_PIN) != 0x00) ? (0x01) : (0x00))//寄存器方式
#define KEY_MEM_PROT_REG  LINK3(CHAR_P,KEY_MEM_PORT,CHAR_M)//PxM
#define KEY_MEM_UP_REG  LINK3(CHAR_P,KEY_MEM_PORT,CHAR_UR)//PxUR


#define FULL_PORT GPIO1
#define FULL_PIN Pin_6
#define FULL    (((LINK2(CHAR_P,FULL_PORT)& FULL_PIN) != 0x00) ? (0x01) : (0x00))//寄存器方式
#define FULL_PROT_REG  LINK3(CHAR_P,FULL_PORT,CHAR_M)//PxM
#define FULL_UP_REG  LINK3(CHAR_P,FULL_PORT,CHAR_UR)

#define CHARGE_PORT GPIO1
#define CHARGE_PIN Pin_4
#define CHARGE  (((LINK2(CHAR_P,CHARGE_PORT) & CHARGE_PIN) != 0x00) ? (0x01) : (0x00))//寄存器方式

#define CHARGE_PROT_REG  LINK3(CHAR_P,CHARGE_PORT,CHAR_M)//PxM
#define CHARGE_UP_REG  LINK3(CHAR_P,CHARGE_PORT,CHAR_UR)



#define BT_POWER_PORT GPIO5 //外接模块供电使能引脚
#define BT_POWER_PIN Pin_3
#define BT_POWER_ON  (LINK2(CHAR_P,BT_POWER_PORT) |= BT_POWER_PIN)
#define BT_POWER_OFF (LINK2(CHAR_P,BT_POWER_PORT) &= ~(BT_POWER_PIN))
#define BT_POWER_PROT_REG  LINK3(CHAR_P,BT_POWER_PORT,CHAR_M)//PxM
#define BT_POWER_UP_REG  LINK3(CHAR_P,BT_POWER_PORT,CHAR_UR)


typedef enum
{
    COLOR_GREEN = 0,//单绿色
    COLOR_MIXED, //混合色
    COLOR_RED, //单红色
    COLOR_ALL_OFF, //全部关闭
}e_color_t;

void aky_gpio_init(void);
void aky_gpio_enter_stop_mode(void);

#endif // 